package cn.itcast.service.impl;

import cn.itcast.dao.AccountDao;
import cn.itcast.domain.Account;
import cn.itcast.service.AccountService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;
    public List<Account> finAll() throws Exception {
        List<Account> all = accountDao.findAll();
        return all;
    }
    @Autowired
    public void delete(Integer id) throws Exception {
        int delete = accountDao.delete(id);
    }

    public void add(Account account) throws Exception {
        int add = accountDao.add(account);
    }

    public void update(Account account) throws Exception {
        int update = accountDao.update(account);
    }

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }
}
